﻿using FriendStar.Code;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using FriendStar.Application.BaseData;
using FriendStar.Domain.Entity.BaseData;


namespace FriendStar.Web.Areas.BaseData.Controllers
{
    public class ZSJ_B1_GH_SIController : ControllerBase
    {
        //制造单位
        // GET: /BaseData/ZSJ_B1_GH_SI/
        private ZSJ_B1_GH_SIApp dutyApp = new ZSJ_B1_GH_SIApp();

        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(string keyword,string isProduct)
        {
            var data = dutyApp.GetList(keyword,isProduct).OrderBy(p=>p.UnitNO);
            return Content(data.ToJson());
        }
        public ActionResult GetProCompany(string isProduct)
        {
            var data = dutyApp.GetList(Configs.GetValue("UseUnit"), isProduct);
            return Content(data.ToJson());
        }   
        
        public ActionResult GetPickCompany(string isCustomer)
        {
            var data = dutyApp.GetPickCompany(Configs.GetValue("UseUnit"), isCustomer);
            return Content(data.ToJson());
        }

        public ActionResult GetStockInfo()
        {
            string unitcode = Configs.GetValue("UseUnit");
            var data = dutyApp.GeStocktList(unitcode);
            return Content(data.ToJson());
        }

        public ActionResult GetProduceUnit()
        {
            string unitcode = Configs.GetValue("UseUnit");
            var data = dutyApp.GetProduceUnit(unitcode);
            return Content(data.ToJson());
        }

        public ActionResult GetStampingOnline(string isStampingRoom)
        {
            string unitcode = Configs.GetValue("UseUnit");
            var data = dutyApp.GetStampingOnline(unitcode,isStampingRoom);
            return Content(data.ToJson());
        }
    }
}

 
 